package com.rocket.bedroom.exceptions;


import com.rocket.bedroom.enums.ResultCode;

/**
 * 自定义异常
 */
public class BusinessException extends RuntimeException {

    protected Integer code;

    protected String message;

    public BusinessException(String message, Integer code) {
        this.message = message;
        this.code = code;
    }

    public BusinessException(ResultCode resultCode) {
        this.code = resultCode.code();
        this.message = resultCode.message();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getMessage() {
        return this.message;
    }
}
